<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="Keywords" content="关键词123">
    <meta name="Description" content="描述">
    <title>{{config('website.website_title')}}-登录页面</title>
    <link rel="stylesheet"   href="{{asset(config('view.frontend.shop_login').'/css/base.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset(config('view.frontend.shop_login').'/css/login.css')}}">
</head>
<body>
<!-- **************头部页面开始****** -->
<div class="w">
    <div id="logo">
        <a href="{{route('f_Shop_index')}}">
            <img src="/login_logo.png" alt="">
        </a>
        <b></b>
    </div>
    <!-- 左边登录logo结束 -->
    {{--<a href="#" class="q_link fr"><b class="fl"></b>登录页面，调查问卷</a>--}}
</div>
<!-- ************头部页面结束********** -->
<div id="content">
    <!-- login-wrapk开始 -->
    <div class="login-wrap">
        <!-- w开始 -->
        <div class="w">
            <!-- *****************登录页面开始************ -->
            <div class="login-form">
                <div class="login-tab login-tab-l" data-target="qrcode-login">
                    <a href="javascript:;">扫码登录</a>
                </div>
                <div class="login-tab login-tab-r" data-target="login-box">
                    <a href="javascript:;">账号登录</a>
                </div>
                <!-- login-box开始（账户登录） -->
                @include('frontend::login.login_layout.account_login')
                <!-- login-box结束（账户登录） -->
                <!-- 二维码登陆开始 （扫码登录）-->
                @include('frontend::login.login_layout.qrcode_login')
                <!-- 二维码登录结束 （扫码登录）-->
                <!-- 登录框底部登录方式 开始qq,微信-->
                <div class="coagent" id="kbCoagent">
                    <ul>
                        <li>
                            <a href="javascript:void(0)" onClick="alert('暂未开放');return false;" class="pdl">
                                <b class="QQ-icon"></b><span>QQ</span>
                            </a>
                            <span class="line">|</span>
                        </li>
                        <li>
                            <a href="javascript:void(0)" onClick="alert('暂未开放');return false;" class="pdl">
                                <b class="weixin-icon"></b><span>微信</span>
                            </a>
                        </li>
                        <li class="extra-r">
                            <div class="regist-link">
                                <a href="{{route('f_Login_register')}}"  class="">
                                    <b></b>立即注册
                                </a>
                            </div>
                        </li>
                    </ul>
                </div>
                <!-- 登录框底部登录方式 结束qq,微信-->
            </div>
            <!-- ************ 登录页面login-form结束************  -->
        </div>
        <!-- w结束 -->
        <!-- 中间广告部分开始 -->
        <div class="login-banner" style="background-color: #fc3343">
            <div class="w">
                <div id="banner-bg" class="i-inner" style="background: url(/{{config('view.frontend.shop_login')}}/picture/nav/a1.jpg);"></div>
            </div>
        </div>
        <!-- 中间背景广告结束 -->
    </div>
    <!-- login-wrap结束 -->
</div>
<!-- 内容部分结束 -->
<!-- 底部页面开始 -->
<div class="w">
    <div id="footer-2013">
        <div class="links">
            <a href="">关于我们</a>
            |
            <a href="">联系我们</a>
            |
            <a href="">人才招聘</a>
            |
            <a href="">商家入驻</a>
            |
            <a href="">广告服务</a>
            |
            <a href="">友情链接</a>
            |
            <a href="">销售联盟</a>
        </div>
    </div>
</div>
<!-- 底部页面结束 -->

</body>
<script src="{{asset(config('view.plugin').'/jquery/jquery-3.2.1.min.js')}}"></script>
<script src="{{asset(config('view.plugin').'/other/qrcode.min.js')}}"></script>
<script src="{{asset(config('view.plugin').'/layui/layui.all.js')}}"></script>
<script src="{{asset(config('view.frontend.shop_login').'/js/checkcode.js')}}"></script>
<script src="{{asset(config('view.frontend.shop_login').'/js/login.js')}}"></script>
<script>
    function makeCode(){
        document.getElementById('qrcode-img').innerHTML = "";
        var qrcode = new QRCode(document.getElementById("qrcode-img"), {
            width : 147,
            height : 147
        });
        qrcode.makeCode('请使用当前商城app扫码,如无原生app,请选择账号登录');
    }
</script>
<script>
    var loginMod = (function () {
        var init = function () {
            $('input').focus(function () {
                $('.msg-error>span').text('');
                $('.msg-error').hide();
            })
        }
        var refreshCaptcha = function (obj) {
            $(obj).attr('src','{{captcha_src()}}?t='+Math.random());
        };
        var submit = function(obj){
            // if(!validate()){
            //     return false;
            // }
            var params = $(obj).data('params');
            var data = $('#'+params.formId).serialize();
            $.ajax({
                type: 'post',
                url: params.url||$('#'+params.formId).attr('action'),
                dataType: 'json',
                data: data
            }).done(function (response) {
                if(response.status){
                    location.href = response.url;
                }else{
                    tooltips(response.msg);
                }
            }).fail(function (XMLHttpRequest) {
                var errorText = '';
                if (XMLHttpRequest.status == 422) {
                    var errors = XMLHttpRequest.responseJSON.errors;
                    if(typeof errors == 'object') {
                        for (var index in errors) { // 不推荐这样
                            errorText = errors[index][0];
                        }
                    }else{
                        errorText = XMLHttpRequest.responseJSON.msg;
                    }
                }else{
                    errorText = '网络获取服务器数据出现问题'
                }
                tooltips(errorText);

            }).always(function () {
                refreshCaptcha($('#refresh'));
            });
        };
        var tooltips = function (msg,icon) {
            $('.msg-error>span').text('').text(msg);
            $('.msg-error').show();
        };
        var validate = function (){
            var res = true;
            $('.form .item input').each(function () {
                var iptVal =$(this).val();
                if(!iptVal){
                    var title = $(this).children('.tip').data('title');
                    $(this).children('.tip').text(title+'不能为空').show();
                    res = false;
                    return false;
                }
            })
            return res;
        };
        return {
            refreshCaptcha:refreshCaptcha,
            submit:submit,
            init:init
        }
    })();
    loginMod.init();
</script>
</html>